/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package wh;

import java.io.IOException;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Dave
 */
public class Player {
    PacketStreamReader reader = null;
    PacketStreamWriter writer = null;
    String name = "";
    Socket sock = null;

    public Player(Socket s) {
        sock = s;
        try {
            reader = new PacketStreamReader(s.getInputStream());
            writer = new PacketStreamWriter(s.getOutputStream());
            //Use this to get rid of the extraneous '0' byte transferred before login
            reader.getDataInput().readByte();
        } catch (IOException ex) {
            Logger.getLogger(Player.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    protected Player() {}

    public PacketStreamReader getReader() {
        return reader;
    }

    public PacketStreamWriter getWriter() {
        return writer;
    }
}
